<?php include_once './application/views/sys_admin/common/header.php';  ?>
<div class="admin_main">
<?php include_once './application/views/sys_admin/common/user_left.php';  ?>
<div class="admin_right">
		<div class="admin_right_title">
			<strong>客户管理</strong> &gt;&gt;  留言列表
		</div>
		
		<div class="admin_right_con">
		  <table border="0" cellspacing="1" cellpadding="0">
			  <tr style="color:#0068b7;">
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>用户名</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>标题</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>内容</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>时间</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>操作</strong></td>
			  </tr>
			  
			  <?php foreach ($leaveword_list as $info) { ?>
			 	<tr id="row_<?php echo $info['id'];?>">
					<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $info['username'];?></td>
					<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $info['title'];?></td>
					<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $info['content'];?></td>
					<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo date('Y-m-d H:i',$info['ftime']);?></td>
					<td height="35" width="55" align="center" valign="middle" bgcolor="#FFFFFF">
						<a href="/sys_admin/leaveword/show_reply_leaveword/<?php echo $info['id'];?>" target="_blank">回复</a>
						<a href="javascript:if(confirm('确定删除留言？')){remove(<?php echo $info['id'];?>);}">删除</a> 
					</td>
				</tr>
			  <?php } ?>
			  <tr>
			  	<td colspan="10" align="right" bgcolor="#FFFFFF">
			  		<form action="" method="get">
			  			用户名：<input type="text" id="username" name="username" value="" />
			  			标题：<input type="text" id="title" name="title" value="" />
			  			<input type="submit" />
			  		</form>
			  	</td>
			  </tr>			  
			  <tr>
			      	<td  height="35" colspan="10" align="center" class="page" bgcolor="#FFFFFF"><?php echo $this->pagination->create_links();?></td>
			  </tr>
			</table>
			</div>
<!-- User_List_Con End -->
</div>
</div>
<!-- User Right End -->

<script>
function remove(id){
	$.ajax({
		type: "post",
		url: "/sys_admin/leaveword/remove/",
		data: "id="+id,
		success: function(msg){
			$("#dialog" ).dialog();
			if(msg == 1){
				$("#msg").html("删除成功！");
				$("#row_"+id).hide();
			}else{
				$("#msg").html("删除失败，请联系管理员！");
			}
			setTimeout(function(){
				$("#dialog" ).dialog("close");
			},3000);
		},
		dataType: "text"
	});
}
</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
</body>
</html>